/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Engine2D.graphics.particle;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Garys
 */
public class GLParticleFactory {

    private static GLParticleRock rockParticle;
    private static GLParticleOre oreParticle;
    private static GLParticleWater waterParticle;
    
    /**
     * 
     * @param type
     * @return
     */
    public static GLParticleInterface getParticle(String type) {
        if (type.equals("rock")) {
            if (rockParticle == null) {
                rockParticle = new GLParticleRock();
            }
            return rockParticle;
        }
        
        if (type.equals("ore")) {
            if (oreParticle == null) {
                oreParticle = new GLParticleOre();
            }
            return oreParticle;
        }
        
        if (type.equals("water")) {
            if (waterParticle == null) {
                waterParticle = new GLParticleWater();
            }
            return waterParticle;
        }

        return null;
    }
}
